id = 0
if id == 0:
    print('red')
elif id == 1:
    print('yellow')
else:
    print('green')

l = [1, 2, 3, 4]
for item in l:
    print(item)

d = {'name': 'jason', 'dob': '2000-01-01', 'gender': 'male'}
for k in d:  # 遍历字典的键
    print(k)

for v in d.values():  # 遍历字典的值
    print(v)

for k, v in d.items():  # 遍历字典的键值对
    print('key: {}, value: {}'.format(k, v))

l = [1, 2, 3, 4, 5, 6, 7]
for index in range(0, len(l)):
    if index < 5:
        print(l[index])

l = [1, 2, 3, 4, 5, 6, 7]
for index, item in enumerate(l):
    if index < 5:
        print(item)

l = [1, 2, 3, 4]
index = 0
while index < len(l):
    print(l[index])
    index += 1
